<?php
include('../../inc/global.inc');
include("../islogin.php");
$url=$_SERVER['HTTP_REFERER'];
?>
<?php
if($_POST[tj_act]){
mysql_query("insert into seo_link  (m_user,s_name,s_web) values ('$_POST[m_user]','$_POST[s_name]','$_POST[s_web]')");

echo "<script>alert('添加成功');location='seo_link.php';</script>";
}
?>
<?php
if($_POST['xg_act']){
mysql_query("update seo_link set m_user='$_POST[m_user]',s_name='$_POST[s_name]',s_web='$_POST[s_web]' where id='".$_POST['iid']."'");

echo "<script>alert('修改成功');location='".$_POST['urls']."';</script>";
}
?>
<HTML>
<HEAD>
<TITLE>Admin</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="../css/css.css" rel=stylesheet>
<script type='text/javascript' src="../js/islogin.js" charset="gb2312"></script>
</HEAD>
<BODY>
<center>
<table width="700" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
    <tr>
      <td height="25" bgcolor="#EEEEF9" style="padding-left:5px;">优化链接&nbsp;&nbsp;<a href="javascript:history.go(-1)">返回</a></td>
    </tr>
  </table>
  <?php
  if($_GET[tj]){
  ?>
<table width="700" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#000000" >
<form action="" method="post" name="form1">
	<tr align='center' bgcolor='#D8EAF4'>
	  <td height="35" colspan="2" valign="middle" nowrap bgcolor="#8DA8CF" class='category'>添加链接</td>
	</tr>
<tr align='center' bgcolor='#FFFFFF'>
  <td width="162" align="center" bgcolor="#8DA8CF">会员账号</td>
  <td width="519" align="left" bgcolor="#FFFFFF" style="padding-left:5px"><input type="text" name="m_user"></td>
</tr>
<tr align='center' bgcolor='#FFFFFF'>
  <td align="center" bgcolor="#8DA8CF">链接名称</td>
  <td width="519" align="left" bgcolor="#FFFFFF" style="padding-left:5px"><input name="s_name" type="text" size="20"></td>
</tr>
<tr align='center' bgcolor='#FFFFFF'>
  <td align="center" bgcolor="#8DA8CF">链接地址</td>
  <td align="left" bgcolor="#FFFFFF" style="padding-left:5px"><input name="s_web" type="text" value="http://" size="40"></td>
</tr>
  <tr align='center' bgcolor='#FFFFFF'><input type="hidden" name="tj_act" value="ok">
  <td colspan="2"><input type="submit" value="添加"></td>
  </tr>
  </form>
</table>
<?php }?>

  <?php
  if($_GET['xg']){
  $row=mysql_fetch_array(mysql_query("select * from seo_link where id='".$_GET['xg_id']."'"));
  ?>
<table width="700" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#000000" >
<form action="" method="post" name="form1">
	<tr align='center' bgcolor='#D8EAF4'>
	  <td height="35" colspan="2" valign="middle" nowrap bgcolor="#8DA8CF" class='category'>修改信息</td>
	</tr>
<tr align='center' bgcolor='#FFFFFF'>
  <td width="162" align="center" bgcolor="#8DA8CF">会员账号</td>
  <td width="519" align="left" bgcolor="#FFFFFF" style="padding-left:5px"><input type="text" name="m_user" value="<?=$row['m_user']?>"></td>
</tr>
<tr align='center' bgcolor='#FFFFFF'>
  <td align="center" bgcolor="#8DA8CF">链接名称</td>
  <td width="519" align="left" bgcolor="#FFFFFF" style="padding-left:5px"><input name="s_name" type="text" size="20" value="<?=$row[s_name]?>"></td>
</tr>
<tr align='center' bgcolor='#FFFFFF'>
  <td align="center" bgcolor="#8DA8CF">链接地址</td>
  <td align="left" bgcolor="#FFFFFF" style="padding-left:5px"><input name="s_web" type="text" value="<?=$row[s_web]?>" size="40"></td>
</tr>
<input type="hidden" name="iid" value="<?=$row['id']?>"><input type="hidden" name="urls" value="<?=$url?>">
  <tr align='center' bgcolor='#FFFFFF'><input type="hidden" name="xg_act" value="ok">
  <td colspan="2"><input type="submit" value="修改"></td>
  </tr>
  </form>
</table>
<?php }?>
</center>
</BODY>
</HTML>

